package com.kkang.ch1.javaconfig;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yongk_liu
 **/
@Configuration
//@ComponentScan//并不使用包扫描，本实例 只使用本类中的注解
public class Javaconfig {

    @Bean//声明此方法返回一个bean
    public FunctionService functionService() {
        return new FunctionService();
    }

    @Bean
    public UseFunctionService userFunctionService() {
        UseFunctionService useFunctionService = new UseFunctionService();
        useFunctionService.setFunctionService(functionService());
        return userFunctionService();
    }

}
